<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ng-readonly</title>
    <script src="../angular.js"></script>
    <style>
        input[readonly]{
            background: red;
        }
    </style>
</head>
<div ng-app="gg" ng-controller="ctrl">

    <!--readonly 可以被提交， disabled不能被提交-->
    <!--<form action="19.php" method="post">-->
        <!--<input name="readonly" type="text" value="readonly" readonly><br />-->
        <!--<input name="disabled" type="text" value="disabled" disabled><br />-->
        <!--<input type="submit" value="提交">-->
    <!--</form>-->
    年龄： <input type="text" ng-model="user.age" /><br />
    邮箱： <input type="text" ng-model="user.email" ng-readonly="user.uid"/><br />
</div>
<script>
    var mod=angular.module('gg', []);
    mod.controller('ctrl', ['$scope', function ($scope) {
        $scope.user={uid : 10, age:18, email: '142690424@qq.com'}
    }])
</script>
</body>
</html>